//动态添加弹窗
function tipInfm(text) {
    var len = $(".tipsWrapper").length;
    if (len > 0) {
        $(".tipsWrapper").show();
        $(".tips .text").html(text);
        $(".sure").click(function () {
            $(".tipsWrapper").hide();
        });
    } else {
        var str = '<div class="tipsWrapper"><div class="mask"></div>' +
            '<div class="tips">' +
            '<p class="title">提示</p>' +
            '<p class="text"></p>' +
            '<p class="sure">确定</p>' +
            '</div></div>';
        $("body").append(str);
        $(".tips .text").html(text);
        $(".sure").click(function () {
            $(".tipsWrapper").hide();
        });
    }
}
//倒计时
var countdown = 60;
function count(val) {
    if (countdown == 0) {
        val.removeAttribute("disabled");
        val.value = "重新获取";
        countdown = 60;
        return;
    } else {
        val.setAttribute("disabled", true);
        val.value = "重发" + countdown + "s";
        countdown--;
        countdown = countdown > 9 ? countdown : "0" + countdown;
    }
    setTimeout(function () {
        count(val);
    }, 1000);
}
//等待加载的弹窗
function loadInfm(text) {
    var loadLen = $(".loadWrapper").length;
    if (loadLen > 0) {
        $(".loadWrapper").show();
        $(".loadText").html(text);
    } else {
        var loadStr = '<div class="loadWrapper">' +
            '<div class="mask"></div>' +
            '<div class="loadingBox">' +
            '<img src="../../images/perfBillImg/loading.gif" alt="" class="loadingImg"/>' +
            '<p class="loadText"></p>' +
            '</div>' +
            '</div>';
        $("body").append(loadStr);
        $(".loadText").html(text);
    }
}
//等待加载的弹窗
function loadInfm1() {
    var loadLen = $(".loadWrapper1").length;
    if (loadLen > 0) {
        $(".loadWrapper1").show();
    } else {
        var loadStr = '<div class="loadWrapper1">' +
            '<div class="loadmask"></div>' +
            '<div class="loadingBox loadingBox1">' +
            '<img src="../../images/perfBillImg/loading.gif" alt="" class="loadingImg"/>' +
            '</div>' +
            '</div>';
        $("body").append(loadStr);
    }

}
//返回上一页
function prevPage() {
    $(".goback").click(function () {
        window.history.go(-1);
    });
}
//返回主页
function goHome() {
    var homeStr = '<a href="" id="homeWrapper"><img src="../../images/perfBillImg/homeImg@2x.png" alt="" id="homeImg" /></a>';
    $("body").append(homeStr);
}
